const Mock =require("mockjs") 
const data=Mock.mock({//直播列表
    code:200,
    "list|30-45":[
        {
            "title":"@ctitle(8,12)",
            "name":"@cname",
            "id":"@id",
            'flag|1':[false,true],
            'status|1':[0,1],
            "timer":"@date('yyyy.MM.dd-HH:mm:ss')",
            "timer2":"@date('yyyy.MM.dd-HH:mm:ss')",
            "duration|1":['3小时24分','5小时6分','4小时3分']
            
        }
    ],
    "info|9-14":[//直播数据详情
        {
            "id|+1":10,
            "title":"@ctitle(12,18)",
            "img":"@image(150x150,@color)",  
            "price|60-200":60,
            "count|1000-6000":1,
            "order|10-100":1,
        }
    ]
})
module.exports=[
    {
        url:'/vue-element-admin/liveList',
        type:'post',
        response:(res)=>{
            const {pageIndex,pageSize}=res.body
            const list=data.list.slice((pageIndex-1)*pageSize,pageIndex*pageSize)
            return {
                code:200,
                data:list,
                total:data.list.length

            }
        }
        
    },
    {//直播数据详情
        url:'/vue-element-admin/liveDetail',
        type:'post',
        response:(res)=>{
            const {pageIndex,pageSize}=res.body
            const info=data.info.slice((pageIndex-1)*pageSize,pageIndex*pageSize)
            return {
                code:200,
                data:info,
                totalNum:data.info.length
            }
        }
    }
]